package chapter10

import org.apache.spark.sql.SparkSession

/**
 * author: 余辉
 * blog: https://blog.csdn.net/silentwolfyh
 * descriptions: 1.1.1.4.从JSON文件进行创建
 * date: 2024 - 09 - 02 2:05 下午
 */
object DataFrameDemo8 {

  def main(args: Array[String]): Unit = {

    val spark: SparkSession = SparkSession.builder()
      .appName(this.getClass.getSimpleName)
      .master("local[*]")
      .getOrCreate()

    val df = spark.read.json("BookData/input/10student.json")
    df.printSchema()
    df.show()
  }
}